<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin:0;padding:0}
        .content{
            text-align: center;
            width:400px;
            margin:100px auto;
        }
        .bg{
            border-radius: 50%;
            animation: animate 2s linear infinite;
            animation-play-state: paused;
        }
        .play-btn{
            width:100px;
        }
        @keyframes animate {
            0%{
                transform: rotate(0deg);
            }
            100%{
                transform: rotate(360deg);
            }
        }
    </style>
    <script src="lib/jquery-3.2.1.js"></script>
</head>
<body>
    <div class="content">
        <img class="bg" src="images/bg.png" alt="">
        <img class="play-btn" src="images/pause.png" alt="">
    </div>
    <script>
        /* 1.定位isPlay控制音乐播放的状态 */
        var isPlay = false;
        $(".play-btn").click(function(){
            if(isPlay){
                isPlay = false
                $(this).attr("src","images/pause.png")
                $(".bg").css({"animationPlayState":"paused"})
            }else{
                isPlay = true;
                $(this).attr("src","images/play.png")
                $(".bg").css({"animationPlayState":"running"})
            }
        })
    </script>
</body>
</html>